package org.example.entity;

import org.example.dao.FullDataMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * DeptMapper类的作用就是填充数据
 */
public class EmployeeDTOMapper implements FullDataMapper<EmployeeDTO> {
    @Override
    public EmployeeDTO map(ResultSet rs) throws SQLException {
        return new EmployeeDTO(
                rs.getInt("emp_id"),       // 添加 emp_id 映射
                rs.getString("emp_name"),
                rs.getString("job"),
                rs.getDate("hire_date"),
                rs.getDouble("sal"),
                rs.getDouble("comm"),
                rs.getString("dept_name"),
                rs.getString("dept_loc")
        );
    }
}